home *** CD-ROM | disk | FTP | other *** search
- // Mechstorms King of Team 2 Hills by giskard.
- // Thanks to Paladlin for all the help in creating this first mechstorm script.
- // This is a team 2 script, mostly team only points but points for damage can be earned by the player.
- // Install into mechwarror4/content/missions/yourmission/scripts and select from mission properties
- // in the mission editor.
- // Your map will need to have the following navpoints & dropzones present for this script to work
- // Team_1_hill
- // Team_2_hill
- // Team1_Dropzone
- // Team2_Dropzone
- // Nav_center
-
- fsm stormytko2h : integer;
-
- const
- #include_ <content\ABLScripts\mwconst.abi>
-
- type
- #include_ <content\ABLScripts\mwtype.abi>
-
- // Vars
-
- var
- static integer Team1;
- static integer Team2;
- static integer Team1_Timer;
- static integer Team2_Timer;
- static integer general_Timer;
-
- static integer Team1_Score_Holder;
- static integer Team2_Score_Holder;
- static integer Max_Score_Holder;
- static integer Radius;
-
- static ObjectID Nav_center;
- static ObjectID Team1Hill;
- static ObjectID Team2Hill;
-
- static ObjectID Team1_Dropzone;
- static ObjectID Team2_Dropzone;
-
- static boolean Team1_In;
- static boolean Team2_In;
-
- // Functions
-
- function init;
- code
- // Changeable Vars
- SetCustomBucketName("Team King of 2 Hills");
- radius = 200; // just change this to change the detection radius of all zones.
- AddCustomBucketParameter(Bucket_FRIENDLY_KILLS,-500);
- AddCustomBucketParameter(Bucket_SUICIDES,-500);
- AddCustomBucketParameter(Bucket_ENEMY_DAMAGE_INFLICT, 1);
- AddCustomBucketParameter(Bucket_ENEMY_KILLS, 50);
- AddCustomBucketParameter(Bucket_FRIENDLY_DAMAGE_INFLICT,-1);
-
- // Leave these Alone
- Settimer(gti_timer_1,0);
- Settimer(gti_timer_2,0);
- Team1 = TeamObjectID(1);
- Team2 = TeamObjectID(2);
- Max_Score_Holder = 50;
-
- Team1_Timer = gti_timer_1;
- Team2_Timer = gti_timer_2;
-
- Team1_In = false;
- Team2_In = false;
-
- Team1hill = ena_Team_1_Hill;
- Team2hill = ena_Team_2_Hill;
- Team1_Dropzone = ena_Team1_Dropzone;
- Team2_Dropzone = ena_Team2_Dropzone;
- Nav_Center = ena_Nav_center;
-
- SetFlagsEnabled(FLAGS_HIDE);
- TrackBucket(Bucket_CUSTOM,0,true);
- AddStandardBuckets;
-
- endfunction;
-
- // Startstate
-
- state startState;
- code
- // Show These Navpoints
- RevealNavPoint(ena_Team_1_Hill);
- RevealNavPoint(ena_Team_2_Hill);
- RevealNavPoint(ena_Team1_Dropzone);
- RevealNavPoint(ena_Team2_Dropzone);
- RevealNavPoint(ena_Nav_Center);
-
- // Set player navpoints at start of game to.....
- TeamSetNav(1,ena_Team_2_Hill);
- TeamSetNav(2,ena_Team_1_Hill);
-
- Trans scoring;
-
- endstate;
-
-
- // timer
-
- state scoring;
- code
-
- // Team 1 scoring
- if ((Team1_In) == false) then
- if (IsWithin(TeamObjectID(1),Team2Hill,radius) == true) then
- Team1_In = true;
- resettimer(Team1_Timer);
- Team1_Score_Holder = 1;
- endif;
- endif;
-
- if ((Team1_In) == true) then
- if (timegreater(Team1_Timer,Team1_Score_Holder)) then
- if (IsWithin(TeamObjectID(1),Team2Hill,radius) == true) then
-
- Team1_Score_Holder = Team1_Score_Holder + 1;
-
- if ((Team1_Score_Holder) < 10) then
- addpoints(Team1, 10);
- Trans scoring;
- endif;
-
-
-
- if ((Team1_Score_Holder) < 20) then
- addpoints(Team1, 20);
- Trans scoring;
- endif;
-
-
- if ((Team1_Score_Holder) < 30) then
- addpoints(Team1, 30);
- Trans scoring;
- endif;
-
-
- if ((Team1_Score_Holder) < 40) then
- addpoints(Team1, 40);
- Trans scoring;
- endif;
-
- if ((Team1_Score_Holder) <> 50) then
- addpoints(Team1, 50);
- Trans scoring;
- endif;
-
- else
- Team1_in = false;
-
- endif;
- endif;
- endif;
-
-
- // Team 2 scoring
-
- if ((Team2_In) == false) then
- if (IsWithin(TeamObjectID(2), Team1Hill, radius)) == true then
- Team2_In = true;
- resettimer(Team2_Timer);
- Team2_Score_Holder = 1;
- endif;
- endif;
-
- if ((Team2_In) == true) then
- if (timegreater(Team2_Timer,Team2_Score_Holder)) then
- if (IsWithin(TeamObjectID(2),Team1Hill,radius) == true) then
-
- Team2_Score_Holder = Team2_Score_Holder +1;
-
- if ((Team2_Score_Holder) < 10) then
- addpoints(Team2, 10);
- Trans scoring;
- endif;
-
- if ((Team2_Score_Holder) < 20) then
- addpoints(Team2, 20);
- Trans scoring;
- endif;
-
- if ((Team2_Score_Holder) < 30) then
- addpoints(Team2, 30);
- Trans scoring;
- endif;
-
- if ((Team2_Score_Holder) < 40) then
- addpoints(Team2, 40);
- Trans scoring;
- endif;
-
- if ((Team2_Score_Holder) <> 50) then
- addpoints(Team2, 50);
- Trans scoring;
- endif;
-
- else
- Team2_In = false;
- endif;
- endif;
- endif;
-
-
-
-
- endstate;
-
-
-
- endfsm.
-
-